The background description provided herein is for the purpose of generally presenting the context of the disclosure. Work of the presently named inventors, to the extent it is described in this background section, as well as aspects of the description that may not otherwise qualify as prior art at the time of filing, are neither expressly nor impliedly admitted as prior art against the present disclosure. Unless otherwise indicated herein, the approaches described in this section are not prior art to the claims in the present disclosure and are not admitted to be prior art by inclusion in this section.
Computer programs, or applications, often include logic for dynamic management of memory allocated to the computer programs or applications by the Operating System (“OS”), also referred to as “run-time memory management.” Often, computer programs or applications acquire large blocks of memory from the system memory pool managed by the OS, then split those blocks into smaller parts, and allocate/de-allocate them for internal use. Memory no longer needed may be retained nonetheless for possible reuse by the application. Though some memory may be returned to the system memory pool and the OS during program execution, the memory allocated to an application is returned in full typically only on exit of the application.
Various techniques may be used to improve dynamic memory management by an application. For example, to reduce memory consumption, memory splitting/coalescing, rounding of user-required sizes and fragmentation avoidance may be implemented. For faster performance, low algorithmic complexity and locality of references may be important. For faster performance and scalability in multi-threaded applications, dynamic memory management by an application may include minimizing data sharing and maximizing concurrency for simultaneous operations. In general, high performance in multi-threaded memory allocation may be achieved by using separate per thread or per central processing unit (“CPU”) memory heaps that mostly operate independently. However, these independent memory heaps may take memory from the same address space, which may be shared among all threads in the application and may also become fragmented, leading to increased memory consumption.
Various approaches for avoiding memory fragmentation may noticeably decrease performance of applications with multiple threads actively allocating and de-allocating dynamic memory. For example, some of these approaches may require that no other memory management operation may be executed at the same time.